<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>添加商品分类</title>

<link rel="stylesheet" type="text/css" href="<?php echo asset_url('js/bootstrap/css/bootstrap.min.css');?>" />
<link rel="stylesheet" type="text/css" href="<?php echo asset_url('js/bootstrap/css/bootstrap-responsive.min.css');?>" />
<script type="text/javascript" src="<?php echo asset_url('js/jquery/jquery.js');?>"></script>

<link rel="stylesheet" type="text/css" href="<?php echo theme_url('css/common.css');?>" />
<script type="text/javascript" src="<?php echo theme_url('js/common.js');?>"></script>

<script type="text/javascript">
	function check()
	{
		if ($.trim($('#name').val()) == '')
		{
			alert('名称必须填写！');
			return false;
		}
		
		return true;
	}
</script>

</head>
<body>

	<?php echo widget('admin/header');?>

	<div id="wrap" class="container">

		<form class="form-horizontal" action="__SELF__" method="post" enctype="multipart/form-data" onsubmit="return check();">

			<div class="btn-toolbar">
				<div class="btn-group">
					<a href="<?php echo $this->session->get('back');?>" class="btn">返回</a>
				</div>
				<div class="btn-group">
					<button type="submit" class="btn btn-primary">提交</button>
				</div>
				<div class="btn-group">
					<button type="reset" class="btn">取消</button>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label" for="name">名称：</label>
				<div class="controls">
					<input type="text" name="name" class="span4" id="name">
				</div>
			</div>

			<div class="control-group">
				<label class="control-label">父分类：</label>
				<div class="controls">
					<select name="parent_id">
						<option value="0">请选择</option>
						<?php foreach ($category_list as $row) {?>
						<option value="<?php echo $row['id'];?>" <?php echo $row['id'] == $parent_id ? 'selected="selected"' : '';?>><?php echo str_repeat('___', $row['level'] - 1).$row['name'];?></option>
						<?php }?>
					</select>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label">图标：</label>
				<div class="controls form-inline">
					<input type="file" name="logo" />
				</div>
			</div>

			<div class="control-group">
				<label class="control-label" for="sequence">排序：</label>
				<div class="controls">
					<input type="text" name="sequence" class="span1" id="sequence">
				</div>
			</div>

			<div class="control-group">
				<label class="control-label" for="title">标题：</label>
				<div class="controls">
					<input type="text" name="title" class="span4" id="title">
				</div>
			</div>

			<div class="control-group">
				<label class="control-label" for="keywords">关键词：</label>
				<div class="controls">
					<input type="text" name="keywords" class="span6" id="keywords">
				</div>
			</div>

			<div class="control-group">
				<label class="control-label" for="description">描述：</label>
				<div class="controls">
					<textarea name="description" class="span6" rows="4" id="description"></textarea>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label">内容：</label>
				<div class="controls">
					<?php echo editor('content', '', 800, 300);?>
				</div>
			</div>

			<div class="form-actions">
				<button type="submit" class="btn btn-primary">提交</button>
				<button type="reset" class="btn">取消</button>
			</div>

		</form>

	</div>

	<?php echo widget('admin/footer');?>

</body>
</html>